<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="stripes" uri="http://stripes.sourceforge.net/stripes.tld"%>
<%@ page import="java.util.List"%>
<%@ page import="cm.data.association.entity.UserRelationship"%>
<%@ page import="cm.app.user.form.UserForm"%>
<%
	UserForm form = (UserForm) request.getAttribute("form");
    List<UserRelationship> data = (List<UserRelationship>) form.getData();
	String pageNo = (String) form.getPageNo();
	String pageCount = (String) form.getPageCount();
	String dataCount = (String) form.getDataCount();
%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>c2ms</title>
</head>
<body>
	<input type="hidden" id="pageNo" name="pageNo" value="<%=pageNo %>"/>
		<table style="border-collapse: collapse; border: 1px solid #000000;" align="center" width="75%">
			<tr bgcolor="#d4d0c8">
				<td style="border: 1px solid #000000;">NO</td>
				<td style="border: 1px solid #000000;">LOGIN ID</td>
				<td style="border: 1px solid #000000;">NAME</td>
				<td style="border: 1px solid #000000;">ORGANIZATION ID</td>
				<td style="border: 1px solid #000000;">ORGANIZATION NAME</td>
				<td style="border: 1px solid #000000;">ACCESS END DATE</td>
				<td style="border: 1px solid #000000;"></td>
			</tr>
			<%
				if (data != null && data.size() > 0) {
				    for (int i = 0; data != null && i < data.size(); i++) {
						UserRelationship userInfo = (UserRelationship) data.get(i);
			%>
				<tr>
					<td style="border: 1px solid #000000;">
						<%=(Integer.parseInt(pageNo) * Integer.parseInt(pageCount)) + i + 1%>
					</td>
					<td style="border: 1px solid #000000;"><%=userInfo.getLoginId()%></td>
					<td style="border: 1px solid #000000;"><%=userInfo.getName()%></td>
					<td style="border: 1px solid #000000;"><%=userInfo.getOrganizationId()%></td>
					<td style="border: 1px solid #000000;"><%=userInfo.getOrganizationName()%></td>
					<td style="border: 1px solid #000000;"><%=userInfo.getAccessEndDate()%></td>
					<td style="border: 1px solid #000000;">
						<input type="submit" name="delete" value="削除" onclick="invoke_delete(document.forms['userForm'], 'delete', 'userInfoDiv', '<%=userInfo.getLoginId()%>')" />
					</td>
				</tr>
			<% } %>
			<tr bgcolor="#d4d0c8">
				<td align="right" style="border: 1px solid #000000;" colspan="9">
					<% if(Integer.parseInt(pageNo) > 0) { %>
						<a href="#" style="text-decoration: none" onclick="invoke_page(document.forms['userForm'], 'search', 'userInfoDiv', 'sub')">&lt;&lt;</a>&nbsp;
					<% } %>
					<% if(Integer.parseInt(pageNo) < (Integer.parseInt(dataCount)/Integer.parseInt(pageCount))) { %>
						<a href="#" style="text-decoration: none" onclick="invoke_page(document.forms['userForm'], 'search', 'userInfoDiv', 'add')">&gt;&gt;</a>
					<% } %>
				</td>
			</tr>
		</table>
	<% } %>
</body>
</html>